package gui.panels;

import gui.containerDate.Nodes;

import java.awt.CardLayout;
import java.awt.Dimension;

import javax.swing.JPanel;


public class PanelCardLayaut extends JPanel {
	private JPanel jPanelGroup;
	private JPanel jPanelStudent;
	private JPanel defaultPanel;
	private static PanelCardLayaut panelCardLayaut = null;
	
	private PanelCardLayaut(){
		initGui();
	}
	
	public static PanelCardLayaut getInstance(){
		if(panelCardLayaut == null) {
			panelCardLayaut = new PanelCardLayaut();
		}
		return panelCardLayaut;
	}

	private void initGui() {
		
		jPanelStudent = PanelStudent.getInstance();
		jPanelGroup = PanelGroup.getInstance();
		
		
		CardLayout cards = new CardLayout();
		this.setLayout(cards);
		this.add(jPanelGroup, Nodes.GROUPS.toString());
		this.add(jPanelStudent, Nodes.STUDENTS.toString());

		((CardLayout) this.getLayout()).show(this, "Group");
		defaultPanel=jPanelGroup;
	}
	
	public JPanel getPanelStudent(){
		return jPanelStudent;
	}	
	public JPanel getPanelGroup(){
		return this.jPanelGroup;
	}
}
